package com.prs.crm.action.project;

import org.apache.struts2.convention.annotation.Action;
import org.courser.struts.BaseAction;

import com.prs.crm.context.AppContext;
import com.prs.crm.domain.hr.Person;
import com.prs.crm.service.project.TaskService;
import com.prs.crm.vo.project.TaskStatVo;

public class IndexAction  extends BaseAction{
	private TaskService taskService;
	private TaskStatVo taskStatVo;
	
	@Action("index")
	public String index() {
		Person person = AppContext.getAccountContext().currentUser();
		taskStatVo = new TaskStatVo();
		taskStatVo.setExecuteTaskCount(this.getTaskService().countExecuteTask(person));
		taskStatVo.setJoinTaskCount(this.getTaskService().countJoinTask(person));
		taskStatVo.setVerifyTaskCount(this.getTaskService().countVerifyTask(person));
		taskStatVo.setReportSubmitTaskCount(this.getTaskService().countSumitReportTask(person));

		taskStatVo.setInValidTaskCount(this.getTaskService().countInValidTask(person));
		return SUCCESS;
	}

	public TaskService getTaskService() {
		return taskService;
	}

	public void setTaskService(TaskService taskService) {
		this.taskService = taskService;
	}

	public TaskStatVo getTaskStatVo() {
		return taskStatVo;
	}

	public void setTaskStatVo(TaskStatVo taskStatVo) {
		this.taskStatVo = taskStatVo;
	}
}
